<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="robots" content="noodp" />
        <title>Powershell或cmd设置代理 - Xzap&#39;s 缓存区</title><meta name="Description" content=""><meta property="og:title" content="Powershell或cmd设置代理" />
<meta property="og:description" content="Powershell或cmd设置代理 设置代理 netsh winhttp set proxy 127.0.0.1:10808 取消代理 netsh winhttp reset proxy 查看代理 netsh winhttp show proxy 临时设置代理 $Env:http_proxy=&#34;http://127.0.0.1:10809&#34;; $Env:https_proxy=&#34;http://127.0.0.1:10809&#34;; 还是这句比较好用 $PSDefaultParameterValues = @{ &#34;*:Proxy&#34;=&#34;http://127.0.0.1:10809&#34; } Scoop代" />
<meta property="og:type" content="article" />
<meta property="og:url" content="http://xzap.gitee.io/posts/powershell_cmd_proxy/" /><meta property="article:section" content="posts" />
<meta property="article:published_time" content="2021-03-12T05:54:00+08:00" />
<meta property="article:modified_time" content="2021-03-12T05:54:00+08:00" /><meta property="og:site_name" content="Xzap&#39;s 缓存区" />

<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="Powershell或cmd设置代理"/>
<meta name="twitter:description" content="Powershell或cmd设置代理 设置代理 netsh winhttp set proxy 127.0.0.1:10808 取消代理 netsh winhttp reset proxy 查看代理 netsh winhttp show proxy 临时设置代理 $Env:http_proxy=&#34;http://127.0.0.1:10809&#34;; $Env:https_proxy=&#34;http://127.0.0.1:10809&#34;; 还是这句比较好用 $PSDefaultParameterValues = @{ &#34;*:Proxy&#34;=&#34;http://127.0.0.1:10809&#34; } Scoop代"/>
<meta name="application-name" content="Xzap&#39;s 缓存区">
<meta name="apple-mobile-web-app-title" content="Xzap&#39;s 缓存区"><meta name="theme-color" content="#ffffff"><meta name="msapplication-TileColor" content="#da532c"><link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
        <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
        <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"><link rel="manifest" href="/site.webmanifest"><link rel="canonical" href="http://xzap.gitee.io/posts/powershell_cmd_proxy/" /><link rel="prev" href="http://xzap.gitee.io/posts/switch-wsl2/" /><link rel="next" href="http://xzap.gitee.io/posts/yanzhengma/" /><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/normalize.css@8.0.1/normalize.min.css"><link rel="stylesheet" href="/css/style.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1.1/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@4.1.1/animate.min.css"><script type="application/ld+json">
    {
        "@context": "http://schema.org",
        "@type": "BlogPosting",
        "headline": "Powershell或cmd设置代理",
        "inLanguage": "zh-CN",
        "mainEntityOfPage": {
            "@type": "WebPage",
            "@id": "http:\/\/xzap.gitee.io\/posts\/powershell_cmd_proxy\/"
        },"genre": "posts","keywords": "Powershell, proxy","wordcount":  84 ,
        "url": "http:\/\/xzap.gitee.io\/posts\/powershell_cmd_proxy\/","datePublished": "2021-03-12T05:54:00+08:00","dateModified": "2021-03-12T05:54:00+08:00","publisher": {
            "@type": "Organization",
            "name": ""},"author": {
                "@type": "Person",
                "name": "xzap"
            },"description": ""
    }
    </script></head>
    <body data-header-desktop="fixed" data-header-mobile="auto"><script type="text/javascript">(window.localStorage && localStorage.getItem('theme') ? localStorage.getItem('theme') === 'dark' : ('auto' === 'auto' ? window.matchMedia('(prefers-color-scheme: dark)').matches : 'auto' === 'dark')) && document.body.setAttribute('theme', 'dark');</script>

        <div id="mask"></div><div class="wrapper"><header class="desktop" id="header-desktop">
    <div class="header-wrapper">
        <div class="header-title">
            <a href="/" title="Xzap&#39;s 缓存区">Xzap&#39;s 缓存区</a>
        </div>
        <div class="menu">
            <div class="menu-inner"><a class="menu-item" href="/posts/"> 文章 </a><a class="menu-item" href="/tags/"> 标签 </a><a class="menu-item" href="/categories/"> 分类 </a><a class="menu-item" href="/docs/"> 文档 </a><span class="menu-item delimiter"></span><span class="menu-item search" id="search-desktop">
                        <input type="text" placeholder="搜索文章标题或内容..." id="search-input-desktop">
                        <a href="javascript:void(0);" class="search-button search-toggle" id="search-toggle-desktop" title="搜索">
                            <i class="fas fa-search fa-fw" aria-hidden="true"></i>
                        </a>
                        <a href="javascript:void(0);" class="search-button search-clear" id="search-clear-desktop" title="清空">
                            <i class="fas fa-times-circle fa-fw" aria-hidden="true"></i>
                        </a>
                        <span class="search-button search-loading" id="search-loading-desktop">
                            <i class="fas fa-spinner fa-fw fa-spin" aria-hidden="true"></i>
                        </span>
                    </span><a href="javascript:void(0);" class="menu-item theme-switch" title="切换主题">
                    <i class="fas fa-adjust fa-fw" aria-hidden="true"></i>
                </a>
            </div>
        </div>
    </div>
</header><header class="mobile" id="header-mobile">
    <div class="header-container">
        <div class="header-wrapper">
            <div class="header-title">
                <a href="/" title="Xzap&#39;s 缓存区">Xzap&#39;s 缓存区</a>
            </div>
            <div class="menu-toggle" id="menu-toggle-mobile">
                <span></span><span></span><span></span>
            </div>
        </div>
        <div class="menu" id="menu-mobile"><div class="search-wrapper">
                    <div class="search mobile" id="search-mobile">
                        <input type="text" placeholder="搜索文章标题或内容..." id="search-input-mobile">
                        <a href="javascript:void(0);" class="search-button search-toggle" id="search-toggle-mobile" title="搜索">
                            <i class="fas fa-search fa-fw" aria-hidden="true"></i>
                        </a>
                        <a href="javascript:void(0);" class="search-button search-clear" id="search-clear-mobile" title="清空">
                            <i class="fas fa-times-circle fa-fw" aria-hidden="true"></i>
                        </a>
                        <span class="search-button search-loading" id="search-loading-mobile">
                            <i class="fas fa-spinner fa-fw fa-spin" aria-hidden="true"></i>
                        </span>
                    </div>
                    <a href="javascript:void(0);" class="search-cancel" id="search-cancel-mobile">
                        取消
                    </a>
                </div><a class="menu-item" href="/posts/" title="">文章</a><a class="menu-item" href="/tags/" title="">标签</a><a class="menu-item" href="/categories/" title="">分类</a><a class="menu-item" href="/docs/" title="">文档</a><a href="javascript:void(0);" class="menu-item theme-switch" title="切换主题">
                <i class="fas fa-adjust fa-fw" aria-hidden="true"></i>
            </a></div>
    </div>
</header><div class="search-dropdown desktop">
        <div id="search-dropdown-desktop"></div>
    </div>
    <div class="search-dropdown mobile">
        <div id="search-dropdown-mobile"></div>
    </div><main class="main">
                <div class="container"><article class="page single"><h1 class="single-title animate__animated animate__flipInX">Powershell或cmd设置代理</h1><div class="post-meta">
            <div class="post-meta-line"><span class="post-author"><a href="https://xzap.gitee.io" title="Author" target="_blank" rel="noopener noreffer author" class="author"><i class="fas fa-user-circle fa-fw" aria-hidden="true"></i>xzap</a>
</span>&nbsp;<span class="post-category">收录于 <a href="/categories/powershell/"><i class="far fa-folder fa-fw" aria-hidden="true"></i>Powershell</a></span></div>
            <div class="post-meta-line"><i class="far fa-calendar-alt fa-fw" aria-hidden="true"></i>&nbsp;<time datetime="2021-03-12">2021-03-12</time>&nbsp;<i class="fas fa-pencil-alt fa-fw" aria-hidden="true"></i>&nbsp;约 84 字&nbsp;
                <i class="far fa-clock fa-fw" aria-hidden="true"></i>&nbsp;预计阅读 1 分钟&nbsp;</div>
        </div><div class="content" id="content"><h2 id="powershell或cmd设置代理">Powershell或cmd设置代理</h2>
<h3 id="设置代理">设置代理</h3>
<pre tabindex="0"><code>netsh winhttp set proxy 127.0.0.1:10808
</code></pre><h3 id="取消代理">取消代理</h3>
<pre tabindex="0"><code>netsh winhttp reset proxy
</code></pre><h3 id="查看代理">查看代理</h3>
<pre tabindex="0"><code>netsh winhttp show proxy
</code></pre><h3 id="临时设置代理">临时设置代理</h3>
<pre tabindex="0"><code>$Env:http_proxy=&#34;http://127.0.0.1:10809&#34;;
$Env:https_proxy=&#34;http://127.0.0.1:10809&#34;;
</code></pre><h3 id="还是这句比较好用">还是这句比较好用</h3>
<pre tabindex="0"><code>$PSDefaultParameterValues = @{ &#34;*:Proxy&#34;=&#34;http://127.0.0.1:10809&#34; }
</code></pre><h3 id="scoop代理">Scoop代理</h3>
<pre tabindex="0"><code>scoop config proxy &#39;localhost:8080&#39;
</code></pre><h3 id="scoop-移除代理">Scoop 移除代理</h3>
<pre tabindex="0"><code>scoop config rm proxy
</code></pre></div><div class="post-footer" id="post-footer">
    <div class="post-info">
        <div class="post-info-line">
            <div class="post-info-mod">
                <span>更新于 2021-03-12</span>
            </div></div>
        <div class="post-info-line">
            <div class="post-info-md"></div>
            <div class="post-info-share">
                <span></span>
            </div>
        </div>
    </div>

    <div class="post-info-more">
        <section class="post-tags"><i class="fas fa-tags fa-fw" aria-hidden="true"></i>&nbsp;<a href="/tags/powershell/">Powershell</a>,&nbsp;<a href="/tags/proxy/">proxy</a></section>
        <section>
            <span><a href="javascript:void(0);" onclick="window.history.back();">返回</a></span>&nbsp;|&nbsp;<span><a href="/">主页</a></span>
        </section>
    </div>

    <div class="post-nav"><a href="/posts/switch-wsl2/" class="prev" rel="prev" title="开关 wsl2"><i class="fas fa-angle-left fa-fw" aria-hidden="true"></i>开关 wsl2</a>
            <a href="/posts/yanzhengma/" class="next" rel="next" title="破解之江汇验证码实现自动赚分">破解之江汇验证码实现自动赚分<i class="fas fa-angle-right fa-fw" aria-hidden="true"></i></a></div>
</div>
</article></div>
            </main><footer class="footer">
        <div class="footer-container"><div class="footer-line">由 <a href="https://gohugo.io/" target="_blank" rel="noopener noreffer" title="Hugo 0.120.4">Hugo</a> 强力驱动 | 主题 - <a href="https://github.com/dillonzq/LoveIt" target="_blank" rel="noopener noreffer" title="LoveIt 0.2.10"><i class="far fa-kiss-wink-heart fa-fw" aria-hidden="true"></i> LoveIt</a>
                </div><div class="footer-line" itemscope itemtype="http://schema.org/CreativeWork"><i class="far fa-copyright fa-fw" aria-hidden="true"></i><span itemprop="copyrightYear">2024</span><span class="author" itemprop="copyrightHolder">&nbsp;<a href="https://xzap.gitee.io" target="_blank">xzap</a></span></div>
        </div>
    </footer></div>

        <div id="fixed-buttons"><a href="#" id="back-to-top" class="fixed-button" title="回到顶部">
                <i class="fas fa-arrow-up fa-fw" aria-hidden="true"></i>
            </a><a href="#" id="view-comments" class="fixed-button" title="查看评论">
                <i class="fas fa-comment fa-fw" aria-hidden="true"></i>
            </a>
        </div><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/autocomplete.js@0.38.1/dist/autocomplete.min.js"></script><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/lunr@2.3.9/lunr.min.js"></script><script type="text/javascript" src="/lib/lunr/lunr.stemmer.support.min.js"></script><script type="text/javascript" src="/lib/lunr/lunr.zh.min.js"></script><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/lazysizes@5.3.1/lazysizes.min.js"></script><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js"></script><script type="text/javascript">window.config={"code":{"copyTitle":"复制到剪贴板","maxShownLines":50},"comment":{},"search":{"highlightTag":"em","lunrIndexURL":"/index.json","lunrLanguageCode":"zh","lunrSegmentitURL":"/lib/lunr/lunr.segmentit.js","maxResultLength":10,"noResultsFound":"没有找到结果","snippetLength":50,"type":"lunr"}};</script><script type="text/javascript" src="/js/theme.min.js"></script></body>
</html>
